/*
 *  This file is part of the SIRIUS libraries for analyzing MS and MS/MS data
 *
 *  Copyright (C) 2024 Bright Giant GmbH
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along with SIRIUS.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 *  https://openapi-generator.tech
 *  Do not edit the class manually.
 */


package io.sirius.ms.sdk.model;

import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import io.sirius.ms.sdk.model.JobState;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;

/**
 * Progress information of a computation job that has already been submitted to SIRIUS.  if  currentProgress &#x3D;&#x3D; maxProgress job is finished and should change to state done soon.  if a job is DONE all results can be accessed via the Project-Spaces api.
 */
@JsonPropertyOrder({
  JobProgress.JSON_PROPERTY_INDETERMINATE,
  JobProgress.JSON_PROPERTY_STATE,
  JobProgress.JSON_PROPERTY_CURRENT_PROGRESS,
  JobProgress.JSON_PROPERTY_MAX_PROGRESS,
  JobProgress.JSON_PROPERTY_MESSAGE,
  JobProgress.JSON_PROPERTY_ERROR_MESSAGE
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0")
public class JobProgress {
  public static final String JSON_PROPERTY_INDETERMINATE = "indeterminate";
  @jakarta.annotation.Nullable
  private Boolean indeterminate;

  public static final String JSON_PROPERTY_STATE = "state";
  @jakarta.annotation.Nullable
  private JobState state;

  public static final String JSON_PROPERTY_CURRENT_PROGRESS = "currentProgress";
  @jakarta.annotation.Nullable
  private Long currentProgress;

  public static final String JSON_PROPERTY_MAX_PROGRESS = "maxProgress";
  @jakarta.annotation.Nullable
  private Long maxProgress;

  public static final String JSON_PROPERTY_MESSAGE = "message";
  @jakarta.annotation.Nullable
  private String message;

  public static final String JSON_PROPERTY_ERROR_MESSAGE = "errorMessage";
  @jakarta.annotation.Nullable
  private String errorMessage;

  public JobProgress() {
  }

  public JobProgress indeterminate(@jakarta.annotation.Nullable Boolean indeterminate) {
    
    this.indeterminate = indeterminate;
    return this;
  }

  /**
   * Is the progress indeterminate or not
   * @return indeterminate
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_INDETERMINATE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Boolean isIndeterminate() {
    return indeterminate;
  }


  @JsonProperty(JSON_PROPERTY_INDETERMINATE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setIndeterminate(@jakarta.annotation.Nullable Boolean indeterminate) {
    this.indeterminate = indeterminate;
  }

  public JobProgress state(@jakarta.annotation.Nullable JobState state) {
    
    this.state = state;
    return this;
  }

  /**
   * Get state
   * @return state
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_STATE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public JobState getState() {
    return state;
  }


  @JsonProperty(JSON_PROPERTY_STATE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setState(@jakarta.annotation.Nullable JobState state) {
    this.state = state;
  }

  public JobProgress currentProgress(@jakarta.annotation.Nullable Long currentProgress) {
    
    this.currentProgress = currentProgress;
    return this;
  }

  /**
   * Current progress value of the job.
   * @return currentProgress
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_CURRENT_PROGRESS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Long getCurrentProgress() {
    return currentProgress;
  }


  @JsonProperty(JSON_PROPERTY_CURRENT_PROGRESS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setCurrentProgress(@jakarta.annotation.Nullable Long currentProgress) {
    this.currentProgress = currentProgress;
  }

  public JobProgress maxProgress(@jakarta.annotation.Nullable Long maxProgress) {
    
    this.maxProgress = maxProgress;
    return this;
  }

  /**
   * Progress value to reach (might also change during execution)
   * @return maxProgress
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_MAX_PROGRESS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Long getMaxProgress() {
    return maxProgress;
  }


  @JsonProperty(JSON_PROPERTY_MAX_PROGRESS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setMaxProgress(@jakarta.annotation.Nullable Long maxProgress) {
    this.maxProgress = maxProgress;
  }

  public JobProgress message(@jakarta.annotation.Nullable String message) {
    
    this.message = message;
    return this;
  }

  /**
   * Progress information and warnings.
   * @return message
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_MESSAGE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getMessage() {
    return message;
  }


  @JsonProperty(JSON_PROPERTY_MESSAGE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setMessage(@jakarta.annotation.Nullable String message) {
    this.message = message;
  }

  public JobProgress errorMessage(@jakarta.annotation.Nullable String errorMessage) {
    
    this.errorMessage = errorMessage;
    return this;
  }

  /**
   * Error message if the job did not finish successfully failed.
   * @return errorMessage
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_ERROR_MESSAGE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getErrorMessage() {
    return errorMessage;
  }


  @JsonProperty(JSON_PROPERTY_ERROR_MESSAGE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setErrorMessage(@jakarta.annotation.Nullable String errorMessage) {
    this.errorMessage = errorMessage;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    JobProgress jobProgress = (JobProgress) o;
    return Objects.equals(this.indeterminate, jobProgress.indeterminate) &&
        Objects.equals(this.state, jobProgress.state) &&
        Objects.equals(this.currentProgress, jobProgress.currentProgress) &&
        Objects.equals(this.maxProgress, jobProgress.maxProgress) &&
        Objects.equals(this.message, jobProgress.message) &&
        Objects.equals(this.errorMessage, jobProgress.errorMessage);
  }

  @Override
  public int hashCode() {
    return Objects.hash(indeterminate, state, currentProgress, maxProgress, message, errorMessage);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class JobProgress {\n");
    sb.append("    indeterminate: ").append(toIndentedString(indeterminate)).append("\n");
    sb.append("    state: ").append(toIndentedString(state)).append("\n");
    sb.append("    currentProgress: ").append(toIndentedString(currentProgress)).append("\n");
    sb.append("    maxProgress: ").append(toIndentedString(maxProgress)).append("\n");
    sb.append("    message: ").append(toIndentedString(message)).append("\n");
    sb.append("    errorMessage: ").append(toIndentedString(errorMessage)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

